
function dayObj(year,month,date){
    this.dom;
    this.year=year;
    this.month=month;
    this.date=date
    this.cal;
    this.dateObj;
    this.selected=false;
    this.setDate();
    this.setDom();
    addEvent(this.dom,'click',this.log.bind(this))
}
dayObj.prototype={
    setDom:function(){
        this.dom=document.createElement('span');
        this.dom.innerHTML=this.date;
        this.dom.className='day';
        var dayNum=this.dateObj.getDay();
        if(dayNum!=6){
            this.dom.style.borderRight='1px solid #fff'
        }
        
    },
    setDate:function(){
        var monStr=this.month>9?this.month:'0'+this.month;
        var initDateStr=this.year+'-'+monStr+'-'+this.date;
        
        this.dateObj=new Date(initDateStr);

    },
    log:function(){
        console.log(this.year+'-'+this.month+'-'+this.date);
        this.selected=!this.selected;
        if(this.selected){
            this.dom.className+=' selected'
        }else{
            this.dom.className=delName(this.dom.className,'selected');
            console.log(this.dom.className)
        }
        if(this.cal.show){
            return;
        }
        showCal=this.cal;
        showCal.showSelf();
    }
}